home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "Limit Window Size Demo"
- ClientHeight = 3165
- ClientLeft = 1350
- ClientTop = 1770
- ClientWidth = 4740
- Height = 3570
- Left = 1290
- LinkTopic = "Form1"
- ScaleHeight = 3165
- ScaleWidth = 4740
- Top = 1425
- Width = 4860
- Begin MsgHook MsgHook
- Left = 120
- Top = 120
- End
- Option Explicit
- Sub Form_Load ()
- ' Setup MsgHook
- MsgHook.HwndHook = Me.hWnd
- MsgHook.Message(WM_GETMINMAXINFO) = True
- End Sub
- Sub MsgHook_Message (msg As Integer, wParam As Integer, lParam As Long, result As Long)
- Dim MinMax As MINMAXINFO
- If msg = WM_GETMINMAXINFO Then
- ' Copy to our local MinMax variable
- hmemcpy MinMax, ByVal lParam, Len(MinMax)
- ' Set minimum/maximum tracking size
- MinMax.ptMinTrackSize.x = 150
- MinMax.ptMinTrackSize.y = 150
- MinMax.ptMaxTrackSize.x = 400
- MinMax.ptMaxTrackSize.y = 400
- ' Copy data back to Windows
- hmemcpy ByVal lParam, MinMax, Len(MinMax)
- result = 0
- End If
- End Sub
-